#!/usr/bin/env python
# -*- coding: UTF-8 -*-
'''
@Project ：图灵学习 
@File    ：13.生成器并发.py
@IDE     ：PyCharm 
@Author  ：ChenLiGao
@Date    ：2024-10-25 15:39
'''
import time


def work1():
    i = 1
    while True:
        time.sleep(1)
        yield i
        i += 1

def work2():
    i = 1
    while True:
        time.sleep(1)
        yield i
        i += 1

def main():
    obj_list = [work1(), work2()]
    for obj in obj_list:
        print(next(obj))
